package service

import (
	"database/sql"
	"monitor/src/mysql"
	"time"

	"github.com/roylee0704/gron"
)

// 定时删除超过一天的数据
func DeleteEveryday(db *sql.DB, ip string) {

	c := gron.New()
	c.AddFunc(gron.Every(24*time.Hour), func() {
		mysql.DeleteByTime(db, ip)
	})
	c.Start()
}
